home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / s342q07.lha / cc.c < prev    next >
C/C++ Source or Header  |  1994-08-02  |  3KB  |  115 lines

  1. /*
  2. *                cc.c
  3. *
  4. * Other Recipient handling for Citadel-86.
  5. */
  6. /*
  7. *                history
  8. *
  9. * 89????? HAW  Created.
  10. */
  11. #include "ctdl.h"
  12. /*
  13. *                contents
  14. *
  15. *    DisplayCC()        writes an Other Recipient somewhere.
  16. *    ShowCC()        show off the list of other recipients.
  17. */
  18. /************************************************************************/
  19. /************************************************************************/
  20. /*
  21. * Preliminary comments & code for CC feature in C-86.
  22. *
  23. * Comments and notes.
  24. *
  25. * o Numerous requests for this feature tend to make it valuable.
  26. *
  27. * o Suggest we have a field which may have multiple instances in any message.
  28. *   This is the 'cc' field.  Suggest further that it be 2 * NAMESIZE bytes
  29. *   long in order to allow node designators.
  30. *
  31. * o Implementation: The getMessage() function should build a linked list
  32. *   (possibly generic list: libarch.c) as it reads in a message of each
  33. *   CC recipient.  Will need to have a disposal function for this list as
  34. *   each message is disposed of.  May take a little code massage to make
  35. *   sure we hit all the high points.
  36. *
  37. * o Only available for Mail>.
  38. * o (Since getMessage handles all the forms of getting messages from any
  39. *   source, this handles all the net forms, too.)
  40. *
  41. * o Code massage points not otherwise covered in this file:
  42. *   - Held Messages.
  43. *   - Interrupted Messages(!).
  44. *   - getMessage().
  45. *   - putMessage() - how do we handle the analog to noteMessage()?  New
  46. *     parameter?
  47. *
  48. * o Network provisions
  49. *   - Net support not present for this type of message.
  50. *   - New field, net only: Recipient override.  Indicates who mail is to be
  51. *     given access to this message, may (easily) exclude recipient specified
  52. *     in the mbto[] field.  New field named mboverride[NAMESIZE * 2].
  53. *   - Like mbCC, should be handled as list with multiple instances.
  54. *   - Check for mail should check this list instead of mbto iff mboverride
  55. *     is present.
  56. *   - mboverride fields will not contain node designators (initially).
  57. *     mbCC fields will, where necessary.
  58. *
  59. * o Other comments and thoughts about design, etc.
  60. *   - Unlogged users should not have access.
  61. *   - List of CC users should be accessible to message writer.
  62. *   - Able to remove someone from list of CC users???
  63. *   - Net designation.  Use STadel's '@' convention?  Seems logical.
  64. *   - NEED FORMAT FOR DISPLAY OF FINISHED & DELIVERED MESSAGE!
  65. *   - NETHACK3.MAN will need updating.
  66. *   -
  67. */
  68. extern MessageBuffer msgBuf;
  69. char CCOutFlag, CCfirst;
  70. /*
  71. * ShowCC()
  72. *
  73. * This function will show off the current list of other recipients.
  74. */
  75. void ShowCC(int where)
  76.   {
  77.   if (HasCC(&msgBuf))
  78.     {
  79.     if (where == SCREEN)
  80.     mPrintf("Other recipients:");
  81.     CCfirst = TRUE;
  82.     CCOutFlag = where;
  83.     RunList(&msgBuf.mbCC, DisplayCC);
  84.     if (where == SCREEN)
  85.     doCR();
  86.  
  87.     }
  88.  
  89.   }
  90. /*
  91. * DisplayCC()
  92. *
  93. * This function writes an Other Recipient somewhere, somehow.
  94. */
  95. void DisplayCC(char *d)
  96.   {
  97.   extern FILE *upfd;
  98.   if (CCOutFlag == SCREEN)
  99.     {
  100.     #ifndef TURBO_C_VSPRINTF_BUG
  101.     mPrintf("%*c%s\n ", (CCfirst) ? 1 : 17, ' ', d);
  102.     #else
  103.     SpaceBug((CCfirst) ? 1 : 17); /* sigh */
  104.     mPrintf("%s\n ", d);
  105.     #endif
  106.  
  107.     }
  108.   else if (CCOutFlag == MSGBASE)
  109.   dPrintf("W%s", d);
  110.   else if (CCOutFlag == TEXTFILE)
  111.   fprintf(upfd, "%s\n", d);
  112.   CCfirst = FALSE;
  113.  
  114.   }
  115.